*** Replication Do-File for Figure 2 & Appendix 4 in BJPS Paper 'A New Dilemma of Social Democracy?' (19/09/23)

*** Pre-Clean Version

***********************************************************************************

version 14
clear all
set more off, perm
set scrollbufsize 300000
set maxvar 32767

use "C:\Users\Zack.Grant\Dropbox (Nuffield College)\PROJECTS\IDENTITYPOL-GB\New Dilemma of Social Democracy Paper\BJPS Replication Files\NewSocDemDilemma_B_postclean.dta" //* Merged, cleaned and reduced version of Wave 10, 19, 20, and 21 of BES Panel.

*** See 'NewSocDemDilemma_B_preclean' for information on coding and variable construction.


************************************ FIGURE 2 ************************************

svyset [pweight= WEIGHT], psu(BES_id)	

* FIGURE 2A (+ Appendix 24)

reg LAB_WC i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE  [pweight= WEIGHT], vce(cluster BES_id)
margins, at(GROUP =(1 2 4)) atmeans saving(file1, replace) 
reg LAB_BME i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE  [pweight= WEIGHT], vce(cluster BES_id)
margins, at(GROUP =(1 2 4)) atmeans saving(file2, replace) 
reg LAB_MC i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE  [pweight= WEIGHT], vce(cluster BES_id)
margins, at(GROUP =(1 2 4)) atmeans saving(file3, replace) 


* FIGURE 2B (+ Appendix 24)

reg LAB_BMEoverWC i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE  [pweight= WEIGHT], vce(cluster BES_id)
margins, at(GROUP =(1 2 4)) atmeans saving(file4, replace) 


** Note: Figures themselves created in Excel.


********************* APPENDIX 4 *********************

*** Replication of Table 1

reg LAB_WC c.LAB_BME##i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE [pweight= WEIGHT], vce(cluster BES_id)

reg LAB_WC c.LAB_BME##i.GROUP VALUES_LR VALUES_AL i.AGEGROUP FEMALE i.COUNTRY i.WAVE [pweight= WEIGHT], vce(cluster BES_id)

reg LAB_WC c.LAB_BME##i.GROUP VALUES_LR VALUES_AL i.LABOUR_ID i.AGEGROUP FEMALE i.COUNTRY i.WAVE [pweight= WEIGHT], vce(cluster BES_id)


*** Replication of Table 2

logit VOTE_LAB c.LAB_BME##i.GROUP c.LAB_MC##i.GROUP c.LAB_WC##i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE [pweight= WEIGHT], vce(cluster BES_id)

logit VOTE_LAB c.LAB_BME##i.GROUP c.LAB_MC##i.GROUP c.LAB_WC##i.GROUP i.AGEGROUP FEMALE i.COUNTRY i.WAVE VALUES_LR VALUES_AL [pweight= WEIGHT], vce(cluster BES_id)


*** Replication of Table 3

logit VOTE_LAB i.GROUP##c.LAB_BMEoverWC i.AGEGROUP FEMALE i.COUNTRY i.WAVE [pweight= WEIGHT], vce(cluster BES_id)

logit VOTE_LAB i.GROUP##c.LAB_BMEoverWC i.AGEGROUP FEMALE i.COUNTRY i.WAVE VALUES_LR VALUES_AL [pweight= WEIGHT], vce(cluster BES_id)




